<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <meta name="description" content="<?php echo ($site_conf["setting_site_title"]); ?>">
    <meta name="author" content="CDCT TEAM.">
    <title>系统后台－文章列表</title>
    
    <link type="text/css" rel="stylesheet" href="/static/common/style/reset.css" />
    <link type="text/css" rel="stylesheet" href="/static/admin/style/basic.css"/>
    <style type="text/css">html,body{height:100%;}html{height:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}</style>
    
    <link rel="stylesheet" href="/static/layui/css/layui.css" type="text/css">

</head>
<body>

    <div class="wrap-page">
        <div id="pageBookList" class="page-content">
            <Admintemplate file="Common/SubTabs"/>
            <div class="box">
                <div class="box-content">
                    <div class="wrap-table">
                        <div class="table-bar table-bar-head clearfix">
                            <div class="fl-l">
                                <div class="tools">
                                    <span class="tool-item"><a class="button button-blue" href="<?php echo U('Backend/article/add');?>">添加文章</a></span>
                                    <span class="tool-item"><a class="button button-red btn-delete-batch" href="javascript:;" data-url="<?php echo U('Backend/article/delete');?>">删除所选</a></span>
                                </div>
                            </div>
                            <div class="fl-r">
                                <div class="tools">
                                    <span class="tool-item"><button onclick="javascript:window.location.replace(window.location.href);" class="button button-default" type="button">刷新列表</button></span>
                                </div>
                            </div>
                        </div>

                        <div class="table-bar table-bar-head data-filter clearfix">
                        <form id="formFilterBook" action="<?php echo U('Backend/article/index');?>" class="form default-style clearfix" method="get">
                        <input type="hidden" name="m" value="Backend" />
                        <input type="hidden" name="c" value="article" />
                        <input type="hidden" name="a" value="index" />
                        <div class="tools">

                        <div class="filter-item">
                        <span class="tool-item tool-text"><?php echo L('article_cateid');?>：</span>
                        <span class="tool-item">
                        <select class="J_cate_select mr10" data-pid="0" data-uri="<?php echo U('backend/article_cate/ajax_getchilds');?>" data-selected="<?php echo ($article["cate_path"]); ?>">
                        </select>
                        <input type="hidden" name="cate_id" id="cate_id" value="<?php echo ($cate_id); ?>" />
                        </span>
                        </div>

                        <div class="filter-item">
                        <span class="tool-item tool-text"><?php echo L('publish_time');?>：</span>
                        <span class="tool-item"><input id="time_start" name="time_start" type="text" class="textfield Wdate" value="<?php echo ($filter["createtime"]["start"]); ?>" placeholder="开始时间" style="width:120px;" /></span>
                        <span class="tool-item tool-text">-</span>
                        <span class="tool-item"><input id="time_end" name="time_end" type="text" class="textfield Wdate" value="<?php echo ($filter["createtime"]["end"]); ?>" placeholder="结束时间" style="width:120px;" /></span>
                        </div>

                        <div class="filter-item">
                        <span class="tool-item tool-text"><?php echo L('status');?>：</span>
                        <span class="tool-item">
                        <select name="status">
                            <option value="null">-<?php echo L('all');?>-</option>
                            <option value="1" <?php if($_GET['status'] == '1'): ?>selected="selected"<?php endif; ?>>已审核</option>
                            <option value="0" <?php if($_GET['status'] == '0'): ?>selected="selected"<?php endif; ?>>未审核</option>
                        </select>
                        </span>
                        </div>

                        <div class="filter-item">
                        <span class="tool-item tool-text"><label for="keyword"><?php echo L('keyword');?>：</label></span>
                        <span class="tool-item"><input id="keyword" name="keyword" type="text" class="textfield" value="<?php echo ($filter["isbn"]); ?>" placeholder="关键字" style="width:120px;" /></span>
                        </div>

                        <div class="filter-item">
                        <span class="tool-item"><button type="submit" class="button button-blue">查询</button></span>
                        <span class="tool-item"><button id="btnClean" type="reset" class="button button-default">重置</button></span>
                        </div>
                        </div>

                        </form>
                        </div>
                            <table class="table default-style" cellpadding="0" cellspacing="0" width="100%">
                                <thead>
                                <tr>
                                    <th width="40"><div class="th-inner"><input type="checkbox" name="checkall" class="J_checkall"></div></th>
                                    <th width="40"><div class="th-inner">序号</div></th>
                                    <th width="40"><div class="th-inner">ID</div></th>
                                    <th><div class="th-inner al-c"><?php echo L('article_title');?></div></th>
                                    <th><div class="th-inner al-c"><?php echo L('article_cateid');?></div></th>
                                    <th><div class="th-inner al-c"><?php echo L('author');?></div></th>
                                    <th><div class="th-inner al-c"><?php echo L('publish_time');?></div></th>
                                    <th><div class="th-inner al-c"><?php echo L('sort_order');?></div></th>
                                    <th><div class="th-inner al-c"><?php echo L('status');?></div></th>
                                    <th width=100><div class="th-inner al-c"><?php echo L('operations_manage');?></div></th>
                                </tr>
                                </thead>
                                <tbody>
                                <?php if(empty($list)): ?><tr class="empty"><td colspan="20"><div class="data-empty">暂无数据</div></td></tr><?php endif; ?>
                                <?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$val): $mod = ($i % 2 );++$i;?><tr>
                                        <td align="center"><input type="checkbox" class="J_checkitem" value="<?php echo ($val["id"]); ?>"></td>
                                        <td align="center"><?php echo ($key+1); ?></td>
                                        <td align="center"><?php echo ($val["id"]); ?></td>
                                        <td align="left"><div class="th-inner al-l"><?php echo ($val["title"]); if(!empty($val['thumb'])): ?><span class="attachment_icon" file-type="image" file-rel="/upload<?php echo ($val["thumb"]); ?>"><img src="/static/admin/css/bgimg/image_s.gif" /></span><?php endif; ?></div></td>
                                        <td align="center"><?php echo ($cate_list[$val['cate_id']]['cate_name']); ?></td>
                                        <td align="center"><?php echo ($val['source']); ?></td>
                                        <td align="center"><?php echo (date('Y-m-d H:i:s',$val["addtime"])); ?></td>
                                        <td align="center"><span data-tdtype="edit" data-field="ordid" data-id="<?php echo ($val["id"]); ?>" class="tdedit"><?php echo ($val["ordid"]); ?></span></td>
                                        <td align="center">
                                            <?php if($val["status"] == 1): ?><i class="layui-icon layui-icon-ok">&#xe605;</i><?php endif; ?>
                                            <?php if($val["status"] == 0): ?><i class="layui-icon layui-icon-no">&#x1006;</i><?php endif; ?></td>
                                        <td align="center">
                                            <a href="<?php echo u('article/edit', array('id'=>$val['id'], 'menuid'=>$menuid));?>"><i class="layui-icon layui-icon-edit">&#xe642;</i><?php echo L('edit');?></a> |
                                            <a href="javascript:void(0);" class="layer_confirm" data-acttype="ajax" data-url="<?php echo u('article/delete', array('id'=>$val['id']));?>" data-msg="<?php echo sprintf(L('confirm_delete_one'),$val['title']);?>"><i class="layui-icon layui-icon-del">&#xe640;</i><?php echo L('delete');?></a>
                                        </td>
                                    </tr><?php endforeach; endif; else: echo "" ;endif; ?>
                                </tbody>
                            </table>
                        <?php if(!empty($page)): ?><div class="table-bar table-bar-foot clearfix page-container">
                                <div class="fl-r">
                                    <div class="tools">
                                    <span class="tool-item tool-text">
                                        <span class="pagging"><?php echo ($page); ?></span>
                                        <span></span>
                                    </span>
                                    </div>
                                </div>
                            </div><?php endif; ?>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <input type="hidden" id="json_cate_list" value='<?php echo ($json_cate_list); ?>'>


<script type="text/javascript" src="/static/common/script/jquery-1.11.1.min.js"></script>
<script src="/static/layer/layer.js" type="text/javascript"></script>
<script type="text/javascript" src="/static/admin/script/common.js"></script>
<script type="text/javascript" src="/static/admin/script/listTable.js"></script>

    <script src="/static/admin/js/common.js"></script>
    <script src="/static/laydate/laydate.js" type="text/javascript"></script>
    <script src="/static/layui/layui.js" type="text/javascript"></script>
    <script>
        laydate.skin('molv');
        laydate({
            elem: '#time_start',
        });
        laydate({
            elem: '#time_end',
        });
        $(function() {
            var cate_path = "<?php echo ($cate_path); ?>"
            var cate_source = $('#json_cate_list').val();
            cate_select_default(cate_source, cate_path)
        });
    </script>


</body>
</html>